package com.spzx.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.spzx.product.domain.ProductDetails;
import com.spzx.product.mapper.ProductDetailsMapper;
import com.spzx.product.service.IProductDetailsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 商品sku属性表 服务实现类
 * </p>
 *
 * @author Login
 * @since 2025-07-17
 */
@Service
public class ProductDetailsServiceImpl extends ServiceImpl<ProductDetailsMapper, ProductDetails> implements IProductDetailsService {

    @Override
    public String[] getDetailsImageUrlList(Long productId) {

        LambdaQueryWrapper<ProductDetails> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ProductDetails::getProductId, productId);
        queryWrapper.select(ProductDetails::getImageUrls);
        ProductDetails productDetails = baseMapper.selectOne(queryWrapper);

        return productDetails.getImageUrls().split(",");
    }
}
